﻿using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using NewsReader.ViewModels;
using NewsReaderApp.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UnitTests
{
    [TestClass]
    public class ViewModelTests
    {
        [TestMethod]
        public async Task ShouldLoadFromIneternet()
        {
            FeedViewModel fvm = new FeedViewModel();

            List<FeedConfig> fcs = new List<FeedConfig>()
            {
                new FeedConfig("Elections", "http://news.yahoo.com/rss/elections/", "News", 1),
                new FeedConfig("US", "http://news.yahoo.com/rss/us", "News", 1),
                new FeedConfig("Dummy1", "http://news.yahoo.com/rss/religion", "News", 1),
                new FeedConfig("Dumm2", "http://news.yahoo.com/rss/world", "News", 1),
                new FeedConfig("Dumm2", "http://news.yahoo.com/rss/crime-trials", "News", 1),
                new FeedConfig("Dumm3", "http://news.yahoo.com/rss/world", "News", 1),
                new FeedConfig("Dumm4", "http://news.yahoo.com/rss/middle-east", "News", 1),
                new FeedConfig("Dumm5", "http://news.yahoo.com/rss/europe", "News", 1),
                new FeedConfig("Dumm6", "http://news.yahoo.com/rss/tv", "News", 1),
                new FeedConfig("Dumm7", "http://news.yahoo.com/rss/celebrity", "News", 1),
                new FeedConfig("Dumm8", "http://news.yahoo.com/rss/marketplace", "News", 1),
                new FeedConfig("Dumm9", "http://news.yahoo.com/rss/earnings", "News", 1),
            };


            await Task.Run(()=> fvm.LoadFeedsFromTheInternet(fcs));


        }
    }
}
